#!/bin/sh

set -e

case "$1" in
	(install)
	@MEMO_LAUNCHCTL_PREFIX@/bin/launchctl load -w @MEMO_PREFIX@/Library/LaunchDaemons/moe.absolucy.logcleaner.plist
	;;
	(upgrade)
	@MEMO_LAUNCHCTL_PREFIX@/bin/launchctl unload @MEMO_PREFIX@/Library/LaunchDaemons/moe.absolucy.logcleaner.plist
	@MEMO_LAUNCHCTL_PREFIX@/bin/launchctl load @MEMO_PREFIX@/Library/LaunchDaemons/moe.absolucy.logcleaner.plist
	;;
	(*)
	exit 0
	;;
esac

exit 0
